package com.gdk.ksoft.ui.sales;

import android.app.Activity;
import android.os.Bundle;
import android.view.KeyEvent;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.gdk.ksoft.R;
import com.gdk.ksoft.assembly.widget.InnerListView;
import com.lidroid.xutils.ViewUtils;
import com.lidroid.xutils.view.annotation.ViewInject;
import com.lidroid.xutils.view.annotation.event.OnClick;

/**
 * 订货会页面
 */
public class SaleOrderActivity extends Activity {

    @ViewInject(R.id.psaleOrder_txtThemeTitle)private TextView txtThemeTitle;//主题标题
    @ViewInject(R.id.psaleOrder_txtTotalMoney)private TextView txtTotalMoney;//合计金额
    @ViewInject(R.id.psaleOrder_imgIcon)private ImageView imgThemeIcon;//主题图标
    @ViewInject(R.id.psaleOrder_listGoods)private InnerListView ilistGoods;//商品列表

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_sale_order);
        ViewUtils.inject(this);
    }

    /**
     * 页面返回
     */
    public void goBack() {
        this.finish();
        overridePendingTransition(android.R.anim.slide_in_left, android.R.anim.slide_out_right);
    }

    @OnClick(value = {R.id.psaleOrder_imgBack})
    public void OnBackClick(View view) {
        goBack();//页面返回
    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if(event.getAction() == KeyEvent.ACTION_DOWN && keyCode == KeyEvent.KEYCODE_MENU){
            goBack();//页面返回
            return true;
        }
        return super.onKeyDown(keyCode, event);
    }

}
